package org.andao.security.rest;

/**
 * REST 认证结果.<p>成功将返回token. 
 *
 * @author Seewo Software - Marco.hu(huzhiguo@cvte.cn)
 *
 */
public class AuthenticationResult {

	public static AuthenticationResult failure(){
		return new AuthenticationResult(Status.FAIL,null);
	}
	
	public static AuthenticationResult sucess(String username){
		return new AuthenticationResult(Status.SUCCESS,username);
	}
	
	public enum Status{
		 SUCCESS, FAIL;
	}
	
	private final Status status;//状态
	private final String username;//用户名
	
	public AuthenticationResult(Status status,String username){
		this.status = status;
		this.username = username;
	}

	public Status getStatus() {
		return status;
	}

	public String getUsername() {
		return username;
	}
	
	
}
